package com.zz.common.entity;

import lombok.Builder;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;


@Data
@Builder
@Slf4j
public class WebResponse implements Serializable {

    private static final long serialVersionUID = 1L;

    private String code;

    private String message;

    private Object data;

    public static WebResponse success() {
        return WebResponse.builder().code("200").message("success").build();
    }

    public static WebResponse success(Object data) {
        return WebResponse.builder().code("200").message("success").data(data).build();
    }

    public static WebResponse fail(String message) {
        return WebResponse.builder().code("500").message(message).build();
    }

    public static WebResponse fail(String code, String message) {
        return WebResponse.builder().code(code).message(message).build();
    }



}
